{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">任务管理</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
            <script type="text/html" id="barTool">
                <a data-open='{:url("detail")}?id={{ d.id }}' data-width="1000" data-height="500" class="layui-btn layui-btn-xs" title="查看">查看</a>
                <a data-open='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs" title="编辑">编辑</a>
                <a href='{:url("delete")}?id={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
            </script>
            <script type="text/html" id="fenpei">
                {{ d.fenpei }}
                <a data-open='{:url("fenpei")}?id={{ d.id }}' data-width="500" data-height="300" class="layui-btn layui-btn-xs" title="分配">分配</a>
            </script>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
layui.use(['yznTable','jquery'], function() {
    var table = layui.yznTable;
    var $ = layui.jquery;

    var init = {
        table_elem: '#currentTable',
        // add_url: "{:url('add')}",
    };
    var tableIns = table.render({
        init: init,
        id:'currentTable',
        elem: '#currentTable',
        toolbar: ['refresh'],
        url: '{:url("index")}',
        search:true,
        cols: [
            [
                { field: 'id',width:80, title: '序号'},
                { field: 'gongdan_nums',width:100,  align: 'left', title: '工单编号'},
                { field: 'product_nums',width:100, title: '产品编号' },
                { field: 'product_title',width:100, title: '产品名称' },
                { field: 'product_guige',width:100, title: '产品规格' },
                { field: 'procedure_nums',width:100, title: '工序编号' },
                { field: 'procedure_title',width:100, title: '工序名称' },
                { field: 'auth',width:300, title: '报工权限' },
                { field: 'end_time',width:300, title: '分配列表',toolbar:'#fenpei' },
                { field: 'ratio',width:100, title: '报工数配比' },
                { field: 'total',width:100, title: '计划数' },
                { field: 'good',width:80, title: '良品数' },
                { field: 'bad',width:80, title: '不良品数' },
                { field: 'status', width:100,title: '工序状态' },
                { field: 'plan_begin_time',width:200, title: '计划开始时间' },
                { field: 'plan_end_time',width:200, title: '计划结束时间' },
                { field: 'actual_begin_time',width:200, title: '实际开始时间' },
                { field: 'actual_end_time',width:200, title: '实际结束时间' },
                { fixed: 'right', width: 200, title: '操作', toolbar: '#barTool' }
            ]
        ],
        page:{},
    });
});
</script>
{/block}